//
//  BFMealTextTableViewCell.m
//  BFoodSystem
//
//  Created by 浙江择富 on 2018/2/3.
//  Copyright © 2018年 陈名正. All rights reserved.
//

#import "BFMealTextTableViewCell.h"

@interface  BFMealTextTableViewCell()<UITextViewDelegate>


@end
@implementation BFMealTextTableViewCell

- (void)awakeFromNib {
    [super awakeFromNib];
    [self setStatusForSubViews];
    
}
- (void)setStatusForSubViews{
    self.mealTextView.font = [UIFont systemFontOfSize:BF_FONTSIZE_a2];
    self.mealTextView.textColor = [UIColor colorWithHex:BF_COLOR_B2];
    self.mealTextView.backgroundColor = [UIColor whiteColor];
    self.backgroundColor = [UIColor colorWithHex:BF_COLOR_B1];
    self.mealTextView.layer.cornerRadius = 5;
    self.mealTextView.layer.borderColor = [UIColor colorWithHex:BF_COLOR_B12].CGColor;
    self.mealTextView.layer.borderWidth = 1;
    self.mealTextView.clipsToBounds = YES;
    self.mealTextView.text = @"请输入套餐简介";
    self.mealTextView.delegate = self;
    
}

- (void)setTextViewText:(NSString *)textStr{
    self.mealTextView.text = textStr;
    self.mealTextView.textColor = [UIColor colorWithHex:BF_COLOR_B5];
}

- (void)textViewPlacehodel{
    self.mealTextView.text = @"请输入套餐简介";
    self.mealTextView.textColor = [UIColor colorWithHex:BF_COLOR_B2];
}

- (BOOL)textViewShouldBeginEditing:(UITextView *)textView{
    if ([self.mealTextView.text isEqualToString:@"请输入套餐简介"] && self.mealTextView.isFirstResponder) {
        self.mealTextView.text = @"";
        self.mealTextView.textColor = [UIColor colorWithHex:BF_COLOR_B5];
    }
    return YES;
}


- (void)textViewDidEndEditing:(UITextView *)textView{
    if ([self.mealTextView.text isEqualToString:@""]) {
        self.mealTextView.text = @"请输入套餐简介";
        self.mealTextView.textColor = [UIColor colorWithHex:BF_COLOR_B2];
    }
}

- (void)setSelected:(BOOL)selected animated:(BOOL)animated {
    [super setSelected:selected animated:animated];

    // Configure the view for the selected state
}

@end
